import type { IList, IResult } from "@/types/common";
import { getAxios, commonAxiosJson, exportExcelAxios } from "@/utils/request.js";
const url = "/admin/order/rent-order";
/* 获取租机订单列表信息 */
export const getRentMobileOrderInfo = <T, D>(params?: D): Promise<IResult<IList<T>>> => {
  return getAxios<IList<T>, D>(url, params);
};
/* 移交订单给客服 */
export const commonOrderDispatch = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/dispatch", params, "PUT");
};
/* 变更配送方式 */
export const putChangeDeliveryTypeInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/change-delivery-type", params, "PUT");
};
/* 变更到店自提店铺 */
export const putChangeStoreInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/change-store", params, "PUT");
};
/* 新机租机订单导出V2 */
export const exportRentMobileOrderInfo = <D>(params: D): Promise<Blob> => {
  return exportExcelAxios<D>(url + "/export", "GET", params);
};

/* 更新订单回执单等图片 */
export const putUpdateImageInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/update-image", params, "PUT");
};
/* 根据对应平台获取店铺信息 */
export const getRentOrderStoreInfo = <T, D>(params?: D): Promise<IResult<T>> => {
  return getAxios<T, D>(url + "/store", params);
};
